package com.famdoc.Exception;

import org.springframework.stereotype.Service;
import java.util.HashSet;
import java.util.Set;

@Service
public class BlacklistService {

    private Set<String> blacklist;

    public BlacklistService() {
        this.blacklist = new HashSet<>();
    }

    // 添加 Token 到黑名单
    public void addToBlacklist(String token) {
        blacklist.add(token);
    }

    // 从黑名单中移除 Token
    public void removeFromBlacklist(String token) {
        blacklist.remove(token);
    }

    // 检查 Token 是否在黑名单中
    public boolean isBlacklisted(String token) {
        return blacklist.contains(token);
    }
}
